--- server/device-old.c	2007-09-30 22:29:47.000000000 +0200
+++ server/device.c	2007-09-30 22:31:45.000000000 +0200
@@ -50,9 +50,12 @@
     void                  *out_data;      /* output data */
 };
 
+static unsigned int generic_device_map_access( unsigned int access );
+
 static void ioctl_call_dump( struct object *obj, int verbose );
 static int ioctl_call_signaled( struct object *obj, struct thread *thread );
 static void ioctl_call_destroy( struct object *obj );
+static unsigned int device_map_access( struct object *obj, unsigned int access );
 
 static const struct object_ops ioctl_call_ops =
 {
@@ -64,7 +67,7 @@
     no_satisfied,                     /* satisfied */
     no_signal,                        /* signal */
     no_get_fd,                        /* get_fd */
-    no_map_access,                    /* map_access */
+    device_map_access,                /* map_access */
     no_lookup_name,                   /* lookup_name */
     no_open_file,                     /* open_file */
     no_close_handle,                  /* close_handle */
@@ -93,7 +96,7 @@
     no_satisfied,                     /* satisfied */
     no_signal,                        /* signal */
     no_get_fd,                        /* get_fd */
-    no_map_access,                    /* map_access */
+    device_map_access,                /* map_access */
     no_lookup_name,                   /* lookup_name */
     no_open_file,                     /* open_file */
     no_close_handle,                  /* close_handle */
@@ -130,7 +133,7 @@
     no_satisfied,                     /* satisfied */
     no_signal,                        /* signal */
     device_get_fd,                    /* get_fd */
-    no_map_access,                    /* map_access */
+    device_map_access,                /* map_access */
     no_lookup_name,                   /* lookup_name */
     device_open_file,                 /* open_file */
     no_close_handle,                  /* close_handle */
@@ -227,6 +230,19 @@
     wake_up( &ioctl->obj, 0 );
 }
 
+static unsigned int generic_device_map_access( unsigned int access )
+{
+    if (access & GENERIC_READ)    access |= FILE_GENERIC_READ;
+    if (access & GENERIC_WRITE)   access |= FILE_GENERIC_WRITE;
+    if (access & GENERIC_EXECUTE) access |= FILE_GENERIC_EXECUTE;
+    if (access & GENERIC_ALL)     access |= FILE_ALL_ACCESS;
+    return access & ~(GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | GENERIC_ALL);
+}
+
+static unsigned int device_map_access( struct object *obj, unsigned int access )
+{
+    return generic_device_map_access( access );
+}
 
 static void device_dump( struct object *obj, int verbose )
 {
